<?php
namespace Api\Controller;

use Think\Controller;

class BaseController extends Controller{
	const SUCCESS = 1;
	const ERROR = 0;
	public function return_app_data($code, $info){
		echo json_encode(['code' => $code, 'info' => $info]);
		exit();
	}

	public function returnSuccess($data = []){
		echo json_encode(['code' => self::SUCCESS, 'data' => $data]);
		exit();
	}

	public function returnError($msg = '' ,$data = []){
		echo json_encode(['code' => self::SUCCESS,'msg' => $msg, 'data' => $data]);
		exit();
	}
}
?>
